<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:hftl="http://hftl.org" xmlns:hf="http://xmlns.jcp.org/jsf/composite/tags"
	template="../templates/template.xhtml">

	<ui:param name="pageTitle" value="#{messages['operation.search']}" />

	<ui:define name="content">
		<hf:searchPanel id="searchPanel" columns="2" backingBean="#{operationBean}">
			<hf:searchField label="#{messages['operation.operationName']}" field="operationName" />
			<hf:searchField label="#{messages['operation.operationDate']}" field="operationDate" />
			<hf:searchField label="#{messages['operation.amount']}" field="amount" />
			<hf:searchField label="#{messages['operation.operationType']}" field="operationType" />
			<hf:searchField id="accountField" label="#{messages['operation.account']}" field="account" childField="accountNumber" popup="true" />
		</hf:searchPanel>

		<hftl:dataList label="#{messages['customers.search.results']}" backingBean="#{operationBean}">
			<hftl:column label="#{messages['operation.account']}" field="account" childField="accountNumber" />
			<hftl:column label="#{messages['operation.operationName']}" field="operationName" />
			<hftl:column label="#{messages['operation.amount']}" field="amount" />
			<!-- Enum label translation done this way, also enum is unsortable, because translation is unknonw -->
			<hftl:column label="#{messages['operation.operationType']}" field="operationType" childField="label" isMessage="true" sort="false" />
			<!-- Date with time format -->
			<hftl:column label="#{messages['operation.operationDate']}" field="operationDate" isDate="true" time="true" />
			<hftl:actionsColumn />
		</hftl:dataList>
		
		<hftl:entityPopup id="accountsPopup" header="#{messages['account.search']}" updateField=":searchPanel:searchForm:accountField:account_child" selection="#{operationBean.filters['account']}"
			backingBean="#{accountBean}" searchField1Label="#{messages['account.accountNumber']}" searchField1="accountNumber"
			column1Label="#{messages['account.accountNumber']}" column1="accountNumber" />
		
		
	</ui:define>
</ui:composition>